import { defHttp } from '@/utils/http/axios'

enum Api {
  topFive = '/dataBoard/energy/getTop5',
  monthSort = '/dataBoard/energy/getCurMonth',
  sevenTrend = '/dataBoard/energy/getSevenTrend',
  monthTrend = '/dataBoard/energy/getMonthTrend',
}
enum whole {
  thisMonth = '/dataBoard/entirety/curMonth',
  lastMonth = '/dataBoard/entirety/lastMonthDosage',
  lastMonthGas = '/dataBoard/entirety/lastMonthGas',
  fu = '/dataBoard/entirety/deviceStatus',
  dateMonthRateCount = '/producion/completercv/dateMonthRateCount',
  dateMonthCount = '/producion/completercv/dateMonthCount',
  dateHisCount = '/producion/completercv/dateHisCount',
  prosalestore = '/producion/prosalestore/total',
  energyStatistics = '/dataBoard/entirety/energyStatistics',
  img = '/scene/pageSelect', // 首页图片
  allImg = '/dataBoard/entirety/scene/other',
}

enum environment {
  current = '/dataBoard/ev/currentValue',
  sort = '/dataBoard/ev/classTrend',
  alarm = '/dataBoard/ev/alarmRecord',
}
enum produce {
  device = '/dataBoard/product/getDeviceVal',
}
enum productionSalesStock {
  list = '/producion/prosalestore/list',
  projectList = '/producion/prosalestore/projectNameList',
}
enum file {
  add = '/dataBoard/entirety/addRoleFile',
  remove = '/dataBoard/entirety/removeFile',
  list = '/dataBoard/entirety/getRoleFile',
}
enum b20 {
  pie = '/chart/dict/radioTypePie',
  letBar = '/chart/dict/totalInfoAndOneInfo',
  middleBar = '/chart/dict/pageUi',
  left4 = '/chart/dict/totalCodeAndInfo',
  right1 = '/chart/dict/uiCop',
  right2 = '/chart/dict/childData',
  right3 = '/chart/dict/childDataCostDiv',
  right4 = '/chart/dict/thisData',
  right5 = '/chart/dict/childDataDiv',
}
export const getAllHomeImg = () => defHttp.get({ url: whole.allImg })
export const getHomeImg = (params) => defHttp.get({ url: whole.img, params })
export const getTopFive = () => defHttp.get({ url: Api.topFive })
export const getMonthSort = () => defHttp.get({ url: Api.monthSort })
export const getSevenTrend = () => defHttp.get({ url: Api.sevenTrend })
export const getMonthTrend = () => defHttp.get({ url: Api.monthTrend })

export const getThisMonth = () => defHttp.get({ url: whole.thisMonth })
export const getLastMonth = () => defHttp.get({ url: whole.lastMonth })
export const getLastMonthGas = () => defHttp.get({ url: whole.lastMonthGas })
export const getFu = () => defHttp.get({ url: whole.fu })
export const getDateMonthRateCount = () => defHttp.get({ url: whole.dateMonthRateCount })
export const getDateMonthCount = () => defHttp.get({ url: whole.dateMonthCount })
export const getDateHisCount = () => defHttp.get({ url: whole.dateHisCount })
export const getProsalestore = () => defHttp.get({ url: whole.prosalestore })
export const getEnergyStatistics = () => defHttp.get({ url: whole.energyStatistics })

export const getEnvironmentCurrent = () => defHttp.get({ url: environment.current })
export const getEnvironmentSort = (params) => defHttp.get({ url: environment.sort, params })
export const getEnvironmentAlarm = () => defHttp.get({ url: environment.alarm })

export const getProduceDevice = () => defHttp.get({ url: produce.device })

export const getPSTList = (data) => defHttp.post({ url: productionSalesStock.list, data })
export const getPSTProjectList = (params) =>
  defHttp.get({ url: productionSalesStock.projectList, params })

export const getLeft4 = (params) => defHttp.get({ url: b20.left4, params })
export const getPie = (params) => defHttp.get({ url: b20.pie, params })
export const getLeftBar = (params) => defHttp.get({ url: b20.letBar, params })
export const getMiddleBar = (params) => defHttp.get({ url: b20.middleBar, params })
export const getRight1 = (params) => defHttp.get({ url: b20.right1, params })
export const getRight2 = (params) => defHttp.get({ url: b20.right2, params })
export const getRight3 = (params) => defHttp.get({ url: b20.right3, params })
export const getRight4 = (params) => defHttp.get({ url: b20.right4, params })
export const getRight5 = (params) => defHttp.get({ url: b20.right5, params })
export const comprehensiveSingleCost = (params) => defHttp.get({ url: '/chart/dict/comprehensiveSingleCost', params })
export const childData = (params) => defHttp.get({ url: '/chart/dict/childData', params })

